package model.autolight.sequential;

import framework.common.DeviceRequest;
import framework.common.DeviceResponse;
import framework.common.SensorRequest;
import framework.sequential.Client;

public class HumanClient extends Client {

	public HumanClient(String user) {
		super(user);
	}

	boolean isSomeoneHere() {
		DeviceRequest request = new DeviceRequest(this);
		request.add(new SensorRequest(SensorRequest.GET, "HUMAN",Integer.valueOf(0)));
		DeviceResponse response =request(request);
		System.out.println(response);
		if (response.hasAttribute("HUMAN")) {
			Integer i = (Integer)response.getAttribute("HUMAN");
			return (i.intValue() != 0);
		}
		return false;
	}
}
